import request from "../utils/request";


export const addRequestService = (form) => {
    const params = new URLSearchParams()
    for(let key in form){
        params.append(key,form[key])
    }
    return request.post("/leave/addRequest",params)
}

export const getByWorkerIdService = (pageNum,pageSize,workerId) => {
    const params={'pageNum':pageNum,'pageSize':pageSize,'workerId':workerId}
    return request.get("/leave/getByWorkerId", {params:params})
}

export const getListService = (pageNum,pageSize) => {
    const params={'pageNum':pageNum,'pageSize':pageSize}
    return request.get("/leave/getList", {params:params})
}

export const passService = (id) => {
    const params = new URLSearchParams()
    params.append("id",id)
    return request.put('/leave/pass',params)
}

export const refuseService = (id) => {
    const params = new URLSearchParams()
    params.append("id",id)
    return request.put('/leave/refuse',params)
}
